/*
 * @lc app=leetcode.cn id=1 lang=javascript
 *
 * [1] 两数之和
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @param {number} target
 * @return {number[]}
 */

var twoSum = function(nums, target) {
  for(let index in nums) {
    if (nums.includes(target - nums[index])) {
        let index2 = nums.indexOf(target - nums[index])
        if (index != index2) {
          return [index, index2]
        }
    } else {
        index ++
    }
  }
  return []
};
// @lc code=end

